// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   PageUtils.java

package dale.web.common.page;


public class PageUtils
{

    public PageUtils()
    {
    }

    public static int getTotalPage(int rowTotal, int blockSize)
    {
        return (int)Math.ceil((double)rowTotal / (double)blockSize);
    }

    public static int getStartRow(int nowPage, int blockSize)
    {
        return (nowPage - 1) * blockSize;
    }

    public static int getStartRow(int nowPage)
    {
        int result = (nowPage - 1) * 10;
        return result >= 0 ? result : 0;
    }

    public static int getEndRow(int startRow, int blockSize)
    {
        return (startRow + blockSize) - 1;
    }

    public static int getStartPage(int nowPage, int blockPage)
    {
        return ((nowPage - 1) / blockPage) * blockPage + 1;
    }

    public static int getEndPage(int startPage, int blockPage)
    {
        return (startPage + blockPage) - 1;
    }
}
